package com.sevenGroup.pawnshop.Utils;

import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class AllException{

    @ExceptionHandler({UsernameNotFoundException.class})
    public Result usernameNotFoundException(UsernameNotFoundException usernameNotFoundException){
        Result fail = Result.fail(null);
        fail.setMessage(usernameNotFoundException.getMessage());
        return fail;
    }

}
